﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    public partial class mainfrom : Form
    {
        public mainfrom()
        {
            InitializeComponent();
        }
        #region 关机按钮实现：鼠标进入 鼠标离开 关闭系统
        private void label2_Click(object sender, EventArgs e)
        {
            pictureBox2.backcolor = Color.Red;
        }

        private void panelrttop_Paint(object sender, PaintEventArgs e)
        {
            //this.Close();
            //this.Dispose();
            //Application.Exit();
            System.Environment.Exit(0);
        }



        private void pictureboxmore_Click(object sender, EventArgs e)
        {
            if （iscollspased)
            {
                panelleft.Width = panelleft.Width + 10;
                if (panelleft.Width >= panelwidth)
                {
                    timer1.Stop();
                    iscollpased = false;
                    this.pefresh();
                }
            } 
            else{
                panelleft.Width = panelleft.Width - 10;
                if (panelleft.Width <= 50)
                {
                    timer1.Stop();
                    iscollpased = true;
                    this.pefresh();
                }
            }
        }

        private void pictureBox2_Click(object sender, EventArgs e)
        {
            //this.Close();
            //this.Dispose();
            //Application.Exit();
            System.Environment.Exit(0);
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            timerl.start();
        }
    }
}
